package com.kamistoat.meimeimall.common.To.EsTo;

import lombok.Data;
import org.springframework.validation.beanvalidation.SpringValidatorAdapter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * SPU上架时，向ES中存放的数据
 * 实际上更多的是保存SKU的信息
 */
@Data
public class SpuUpTo implements Serializable {
    private Long skuId;
    private Long spuId;
    private String skuTitle;
    private String skuSubtitle;
    private BigDecimal price;
    private String skuDefaultImg;
    private Long saleCount;
    private Boolean hasStock;  // 不是和SkuInfoEntity对应
    private Long hotScore;  // 不是和SkuInfoEntity对应
    private Long brandId;
    private Long catalogId;
    private String brandName;  // 不是和SkuInfoEntity对应
    private String brandImg;  // 不是和SKuInfoEntity对应
    private String catalogName;  // 不是和SKuInfoEntity对应
    private List<spuAttrs> attrs;

    @Data
    public static class spuAttrs{
       private Long attrId;  // 都是和ProductAttrValueEntity对应的
       private String attrName;
       //private String attrValue;
        private List<attrValue> attrValues;
    }

    @Data
    public static class attrValue{
        private String attrValue;
    }
}
